import { z } from 'zod';

export const AtomGitGetUserRepositorySchema = z.object({
  allowAutoMerge: z.boolean(),
  allowForking: z.boolean(),
  allowMergeCommit: z.boolean(),
  allowRebaseMerge: z.boolean(),
  allowSquashMerge: z.boolean(),
  allowUpdateBranch: z.boolean(),
  anonymousAccessEnabled: z.boolean(),
  archived: z.boolean(),
  codeOfConduct: z.union([z.string(), z.null()]),
  contributors_url: z.union([z.string(), z.null()]),
  createdAt: z.string(),
  default_branch: z.string(),
  deleteBranchOnMerge: z.boolean(),
  deployments_url: z.union([z.string(), z.null()]),
  description: z.union([z.string(), z.null()]),
  disabled: z.boolean(),
  downloads_url: z.union([z.string(), z.null()]),
  events_url: z.union([z.string(), z.null()]),
  fork: z.boolean(),
  forks: z.number(),
  forksCount: z.number(),
  forks_url: z.union([z.string(), z.null()]),
  full_name: z.string(),
  hasDiscussions: z.boolean(),
  hasDownloads: z.boolean(),
  hasIssues: z.boolean(),
  hasPages: z.boolean(),
  hasProjects: z.boolean(),
  hasWiki: z.boolean(),
  homepage: z.union([z.string(), z.null()]),
  hooksUrl: z.union([z.string(), z.null()]),
  html_url: z.string(),
  id: z.number(),
  isTemplate: z.boolean(),
  languages_url: z.union([z.string(), z.null()]),
  license: z.union([z.string(), z.null()]),
  mergeCommitMessage: z.union([z.string(), z.null()]),
  mergeCommitTitle: z.union([z.string(), z.null()]),
  merges_url: z.union([z.string(), z.null()]),
  mirrorUrl: z.union([z.string(), z.null()]),
  name: z.string(),
  organization: z.union([z.string(), z.null()]),
  owner: z.union([z.string(), z.null()]),
  parent: z.union([z.string(), z.null()]),
  permissions: z.union([z.string(), z.null()]),
  private: z.boolean(),
  pushedAt: z.union([z.string(), z.null()]),
  securityAndAnalysis: z.union([z.string(), z.null()]),
  source: z.union([z.string(), z.null()]),
  squashMergeCommitMessage: z.union([z.string(), z.null()]),
  squashMergeCommitTitle: z.union([z.string(), z.null()]),
  stargazers_url: z.union([z.string(), z.null()]),
  subscribers_url: z.union([z.string(), z.null()]),
  subscription_url: z.union([z.string(), z.null()]),
  svnUrl: z.union([z.string(), z.null()]),
  tagsUrl: z.union([z.string(), z.null()]),
  teamsUrl: z.union([z.string(), z.null()]),
  templateRepository: z.union([z.string(), z.null()]),
  topics: z.array(z.string()),
  updatedAt: z.string(),
  url: z.string(),
  useSquashPrTitleAsDefault: z.boolean(),
  visibility: z.string(),
  webCommitSignoffRequired: z.boolean(),
});

export const AtomGitGetUserRepositoriesSchema = z.array(z.object({
  allowAutoMerge: z.boolean(),
  allowForking: z.boolean(),
  allowMergeCommit: z.boolean(),
  allowRebaseMerge: z.boolean(),
  allowSquashMerge: z.boolean(),
  allowUpdateBranch: z.boolean(),
  anonymousAccessEnabled: z.boolean(),
  archived: z.boolean(),
  default_branch: z.string(),
  deleteBranchOnMerge: z.boolean(),
  description: z.union([z.string(), z.null()]).optional(),
  fork: z.boolean(),
  full_name: z.union([z.string(), z.null()]),
  git_url: z.union([z.string(), z.null()]),
  hasDiscussions: z.boolean(),
  hasDownloads: z.boolean(),
  hasIssues: z.boolean(),
  hasPages: z.boolean(),
  hasProjects: z.boolean(),
  hasWiki: z.boolean(),
  html_url: z.union([z.string(), z.null()]),
  id: z.number(),
  isTemplate: z.boolean(),
  name: z.union([z.string(), z.null()]),
  private: z.boolean(),
  topics: z.array(z.any()),
  useSquashPrTitleAsDefault: z.boolean(),
  webCommitSignoffRequired: z.boolean(),
}));

export const AtomGitGetOrgRepositoriesSchema = z.array(z.object({
  allowAutoMerge: z.boolean(),
  allowForking: z.boolean(),
  allowMergeCommit: z.boolean(),
  allowRebaseMerge: z.boolean(),
  allowSquashMerge: z.boolean(),
  allowUpdateBranch: z.boolean(),
  anonymousAccessEnabled: z.boolean(),
  archived: z.boolean(),
  default_branch: z.string(),
  deleteBranchOnMerge: z.boolean(),
  description: z.union([z.string(), z.null()]).optional(),
  fork: z.boolean(),
  full_name: z.union([z.string(), z.null()]),
  git_url: z.union([z.string(), z.null()]),
  hasDiscussions: z.boolean(),
  hasDownloads: z.boolean(),
  hasIssues: z.boolean(),
  hasPages: z.boolean(),
  hasProjects: z.boolean(),
  hasWiki: z.boolean(),
  html_url: z.union([z.string(), z.null()]),
  id: z.number(),
  isTemplate: z.boolean(),
  name: z.union([z.string(), z.null()]),
  private: z.boolean(),
  topics: z.array(z.any()),
  useSquashPrTitleAsDefault: z.boolean(),
  webCommitSignoffRequired: z.boolean(),
}));
